const int StackSize=1024;
template<class T>
class Seqstack
{
private:
    T data[StackSize];
    int top;
public:
    Seqstack()
    {
        top=-1;
    }
    ~Seqstack()
    {

    }
    void Push(T x);
    T Pop();
    T GetTop();
    bool Empty();
};

template<class T>
void Seqstack<T>::Push(T x)
{
    if (top>=StackSize-1)throw"上溢";
    top++;
    data[top]=x;
}
template<class T>
T Seqstack<T>::Pop()
{
    if(Empty())throw"下溢";
    top--;
    return data[top+1];
}
template<class T>
T Seqstack<T>::GetTop()
{
    if(Empty())throw"下溢";
    return data[top];
}
template<class T>
bool Seqstack<T>::Empty()
{
    if(top==-1)
    {
        return true;
    }
    return false;
}